package com.bdsy.business.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bdsy.business.dao.ExpertEvalMapper;
import com.bdsy.business.model.ExpertEval;
import com.bdsy.business.service.ExpertEvalService;

@Service("expertEvalService")
public class ExpertEvalServiceImpl implements ExpertEvalService {

	@Autowired
	ExpertEvalMapper expertEvalMapper;
	
	@Override
	public boolean insert(ExpertEval expertEval) {
		int number = (int)((Math.random()*9+1)*10000000);
		expertEval.setId(number);
		int result = expertEvalMapper.insert(expertEval);
		return result>0?true:false;
	}

	@Override
	public List<Map> expertEvalById(int shopId) {
		@SuppressWarnings("rawtypes")
		List<Map> expertEvalList = expertEvalMapper.expertEvalById(shopId);
		return expertEvalList;
	}

	@Override
	public List<Map> expertEval() {
		@SuppressWarnings("rawtypes")
		List<Map> expertEvalList = expertEvalMapper.expertEval();
		return expertEvalList;
	}

	@Override
	public boolean update(ExpertEval expertEval) {
		int result = expertEvalMapper.update(expertEval);
		return result>0?true:false;
	}

	@Override
	public boolean delete(List<String> ids) {
		int result = expertEvalMapper.delete(ids);
		return result>0?true:false;
	}

}
